package com.treasure.mall.zbq.common.ienum.product;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.treasure.mall.zbq.common.ienum.base.CodeDescCommonEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author wm
 */
public interface ProductEnums {
    /**
     * 产品类型
     */
    @AllArgsConstructor
    @Getter
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    enum ProductType implements CodeDescCommonEnum {
        NORMAL(0, "普通商品"),
        LIVE_BROADCAST(1, "直播间商品");
        private Integer code;
        private String desc;
    }

    @AllArgsConstructor
    @Getter
    enum SaleType implements CodeDescCommonEnum {
        NORMAL(0, "普通"),
        AUCTION(1, "拍卖");

        private Integer code;
        private String desc;
    }

    /**
     * 服务标签
     */
    @AllArgsConstructor
    @Getter
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    enum ServiceTag implements CodeDescCommonEnum {
        FREE_SHIPPING_NATIONALLY(0, "全国包邮"),
        SEVEN_DAYS_NO_REASON_TO_REFUND(1, "7天无理由退款");
        private Integer code;
        private String desc;
    }

    /**
     * 商品标签
     */
    @AllArgsConstructor
    @Getter
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    enum ProductTag implements CodeDescCommonEnum {
        LEAK_DETECTION(0, "一元捡漏"),
        SEVEN_DAYS_NO_REASON_TO_REFUND(1, "今日甄选"),
        BOUTIQUE_SALE(2, "精品特卖");
        private Integer code;
        private String desc;
    }

    /**
     * 排序类型
     */
    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    enum DataSortField implements CodeDescCommonEnum {
        /**
         * 默认
         */
        DEFAULT(0, "默认"),
        PRICE(1, "价格"),
        TIME(2, "时间");

        private Integer code;
        private String desc;

        DataSortField(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        @Override
        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        @Override
        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }
}